import java.util.Scanner;

class Rectangle {
    protected int length;
    protected int width;

    public Rectangle(int length, int width) {
        this.length = length;
        this.width = width;
    }

    public int getLength() {
        return length;
    }

    public int getWidth() {
        return width;
    }
}

class Square extends Rectangle {
    public Square(int side) {
        super(side, side);
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入长方形的长度：");
        int length = scanner.nextInt();

        System.out.print("请输入长方形的宽度：");
        int width = scanner.nextInt();

        Rectangle rectangle = new Rectangle(length, width);
        System.out.println("长方形的长度：" + rectangle.getLength());
        System.out.println("长方形的宽度：" + rectangle.getWidth());

        int side = Math.min(length, width);
        Square square = new Square(side);
        System.out.println("正方形的边长：" + square.getLength());
    }
}